package cadc.actions;

import java.util.ArrayList;
import java.util.List;

import cadc.daos.GroupDao;
import cadc.models.WorkSet;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class ListValidGroups extends ActionSupport {
	private static String[] typenames = {"学习平台->学习交流网站",
	"学习平台->数据库管理系统",
	"学习平台->CAI教学课件",
	"学习平台->虚拟实验平台",
	"媒体设计->平面设计",
	"媒体设计->动画设计",
	"媒体设计->虚拟设计(人物、场景等)",
	"媒体设计->DV短剧",
	"媒体设计->电子杂志",
	"媒体设计->其他",
	"电子音乐->电子音乐",
	"媒体制作设计类->中华民族文化组"};
	private List<WorkSet> workSets;
	private GroupDao groupDao;
	public String execute(){
		workSets = new ArrayList<WorkSet>();
		for(int i=0; i<typenames.length; i++){
			WorkSet ws = new WorkSet();
			ws.setWorkType(i);
			ws.setTypeName(typenames[i]);
			ws.setGroupList(groupDao.listGroupWithFirstMemByWorkType(i, 2));
			workSets.add(ws);
		}
		return SUCCESS;
	}
	public List<WorkSet> getWorkSets() {
		return workSets;
	}
	public void setWorkSets(List<WorkSet> workSets) {
		this.workSets = workSets;
	}
	public GroupDao getGroupDao() {
		return groupDao;
	}
	public void setGroupDao(GroupDao groupDao) {
		this.groupDao = groupDao;
	}
}
